package com.itheima.mapper;

import com.itheima.domain.ClassQuerParam;
import com.itheima.domain.pojo.Clazz;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface ClazzMapper {
    @Select("select id, name, room, begin_date, end_date, master_id, subject, create_time, update_time from clazz order by update_time desc")
    List<Clazz> list();
//    @Insert("insert into clazz(name, room, begin_date, end_date, master_id, subject, create_time, update_time) values(#{name}, #{room}, #{beginDate}, #{endDate}, #{masterId}, #{subject}, #{createTime}, #{updateTime})")
//    void insert( Clazz clazz);

//    @Insert("insert into clazz(name, room, begin_date, end_date, master_id, subject, create_time, update_time) values(#{name}, #{room}, #{beginDate}, #{endDate}, #{masterId}, #{subject}, #{createTime}, #{updateTime})")
    void insert(Clazz clazz);

    List<Clazz> lists(ClassQuerParam classQuerParam);

    @Delete("delete from clazz where id = #{id}")
    void delete(Integer id);

    Clazz selectById(Integer id);

    void updateById(Clazz clazz);


}
